package com.atguigu.gulimall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 孟享广
 * @date 2021-01-28 1:04 下午
 * @description
 */
@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {

    /**
     * 默认只支持get  若前端post请求，forward:/reg.html转发过来会报错 Request method 'POST' not supported
     * "reg"直接渲染页面不会报错
     * @param registry
     */

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
